package com.dindang.propertyfee.mvp.model;

import android.app.Application;

import com.dindang.propertyfee.mvp.contract.OwnerSearchContract;
import com.dindang.propertyfee.mvp.model.api.service.CommonService;
import com.dindang.propertyfee.mvp.model.entity.BaseResponse;
import com.dindang.propertyfee.mvp.model.entity.PropertyCharge;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;


@ActivityScope
public class OwnerSearchModel extends BaseModel implements OwnerSearchContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public OwnerSearchModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<BaseResponse<PropertyCharge.RecentBill>> queryRecentBill(PropertyCharge.RecentBillParam param) {
        Observable<BaseResponse<PropertyCharge.RecentBill>> base = mRepositoryManager.obtainRetrofitService(CommonService.class).queryRecentBill(
                param.page,
                param.rows,
                param.likeValue,
                param.corpid);
        return base;
    }
}